#include "widget.h"
#include "ui_widget.h"

#include <QPushButton>
#include <QDebug>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
//    QPushButton *button = new QPushButton(this);
//    button->setText("hello world");

//    connect(button, &QPushButton::clicked, this, &Widget::handler);
}

Widget::~Widget()
{
    delete ui;
}

//void Widget::handler()
//{
//    setWindowTitle("hello");
//}


void Widget::on_pushButton_enable_clicked()
{
    bool enable = ui->pushButton->isEnabled();
    if(enable) ui->pushButton->setEnabled(false);
    else ui->pushButton->setEnabled(true);
}

void Widget::on_pushButton_clicked()
{
    qDebug() << "执行槽函数\n";
}
